﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Controls_Ad7 : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            Content_Down_ad();
        }
    }
    public void Content_Down_ad()
    {
        DataTable dt6 = Class1.ExecSel("select ad_Lock,ad_Url,ad_Img,ad_Location,ad_Time from AD where ad_Location=7 order by ad_ID desc");
        if (dt6.Rows[0]["ad_Lock"].ToString() == "0")
        {
            ad7.Text = "<a href=" + dt6.Rows[0]["ad_Url"].ToString() + " target=_blank><img src=" + dt6.Rows[0]["ad_Img"].ToString() + " border=0 width=669 height=49/></a>";
        }
        else
        {
            ad7.Text = "<img src=img/ad7.gif />";
        }
    }
}
